import Vue from 'vue'
import App from './App.vue'
import Vuex from 'vuex'
import store  from './store'
import axios from './axios'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import router from './router/index.js'
Vue.use(Vuex)
Vue.use(ElementUI)
Vue.prototype.$axios = axios
require("./mock") //引入mock数据，关闭则注释该行
// 路由跳转时，判断是否登录，否则跳转到登录
// router.beforeEach(function(to,from,next){
// 	if(store.state.token!="" || to.path==='/login'){
// 		next();
// 	}else{
// 		next({path:'/login'})
// 	}
	
	
// })
new Vue({
  render: h => h(App),
  //通过router 配置参数 注入到路由当前的vue实例中 要想调用路由 直接this.$router
  router,
  axios,
  store
}).$mount('#app')

